package main.java.DMDE.model.relationships;

import main.java.DMDE.styling.StyleConstants;

import java.util.UUID;

import main.java.DMDE.model.Diagram;
import main.java.DMDE.model.relationships.strategy.AgregationStrategy;

public class Agregation extends Relationship {

    private Direction direction;

    public Agregation(RelationshipComponent componentA,
	    RelationshipComponent componentB,UUID id) {
		super(componentA, componentB, id);
		linkName = StyleConstants.RELATIONSHIP_LINK_AGREGATION_STYLE;
    }

    public Agregation(Diagram diagram,UUID id) {
    	super(id);
		this.validationStrategy = new AgregationStrategy(diagram);
		linkName = StyleConstants.RELATIONSHIP_LINK_AGREGATION_STYLE;
    }

    public Agregation(Diagram diagram) {
    	this.validationStrategy = new AgregationStrategy(diagram);
    	linkName = StyleConstants.RELATIONSHIP_LINK_AGREGATION_STYLE;
    }

	@Override
    public void setDirection(Direction direction) {
	if (!direction.equals(Direction.BOTH))
	    this.direction = direction;
    }

    @Override
    public Direction getDirection() {
	return direction;
    }

    @Override
    public RelationshipTypes getType() {
	return RelationshipTypes.Agregation;
    }

}
